#coding=utf-8
import os
import time
import sys
sys.path.append("..")
from selenium import webdriver
from framework.logger import Logger

mylogger = Logger(logger ='TestMyLog').getlog
class TestMyLog(object):

    def print_log(self):
        dir = os.path.dirname(os.path.abspath('.'))
        chrome_driver_path = dir + '/tools/chromedriver.exe'
        driver = webdriver.Chrome(chrome_driver_path)
        mylogger.info(u"打开浏览器")
        driver.maximize_window()
        mylogger.info(u'窗口最大化')
        driver.implicitly_wait(5)

        driver.get('www.baidu.com')
        mylogger.info(u'打开百度首页')
        time.sleep(2)
        mylogger.info(u'暂停2秒')
        driver.quit()
        mylogger.info(u'关闭并退出浏览器')

#if __name__ =='__main__':
testlog=TestMyLog()
testlog.print_log()